<?php

namespace app\migration;

use yii\base\BootstrapInterface;
use app\base\classes\Hook;

use app\module\BaseModule;
use app\system\enums\ModuleGroupEnmu;

class Module extends BaseModule implements BootstrapInterface
{
    public $migrationPath = "@app/install/migrations";
    
    public function init()
    {
        parent::init();
    }

    public function bootstrap($app)
    {
        Hook::on(\app\system\Module::EVENT_SYSTEM_GROUPNAV, [
            $this,
            "onSetGroupNav"
        ]);
    }

    /**
     *
     * @param \app\base\helpers\Event $event
     */
    public function onSetGroupNav($event)
    {

        $item = [
            'label' => "数据管理",
            'icon' =>  "fa-database" ,
            'url' => [
                "/$this->id/default/index"
            ]
        ];
        
        $event->parameters->set(ModuleGroupEnmu::SYSTEM,[$item]);
    }
}

?>